﻿ <!DOCTYPE html>
<html>
 <body>
   
  <script>
   var x =2;
   var y=3;
   var z = x+3;
   
   document.write(x + "<br>");
   document.write(y + "<br>");
   document.write(z + "<br>")
   
   
   var pi =3.14;
   var name ="Bill Gates";
   var answer = "Yes I am!";
   document.write(pi+"<br>");
   document.write(name +"<br>");
   document.write(answer+"<br>")
     
   
   </script>
   
   <button onclick="myFunction()">点击这里</button>
   <p id = "demo"></p>
    <script>
	  function myFunction(){
	   var carname= "Volvo";
	   document.getElementById("demo").innerHTML=carname;
	  }
	</script>
 
 
  <script>
     var name="Gates",age =56,job="CEO";
	 var carname="Volvo";
	 var carname;
	 
	 document.write(age + "<br>");
	 document.write(carname+"<br>");
	 
	 function addFunction(){
	  var y=5;
	  var x=y+2;
	  var demop=document.getElementById("demo");
	  demop.innerHTML="X=" +x;
	 }
	 
	 
  </script> 
  
  <button onclick="addFunction()">两数相加</button>
 
 </body>
</html>